import React, {FC, ReactElement} from 'react';
import {
    Navigate
} from "react-router-dom";
import {useSelectorAuth} from "@/store/slice/auth";
const AuthComponent:FC<any> = props =>{
    const auth = useSelectorAuth()
    return auth.token?props.children:<Navigate to={"/login"}/>;
}

export default AuthComponent;